import http from '../utils/request'
import { AxiosResponse } from 'axios'


// 查询全部角色接口
export const getrolelist = (params: any): Promise<AxiosResponse<any>> => {
    return http.get("/role/list", params)
}

// 添加角色接口
export const getroleadd = (params: any): Promise<AxiosResponse<any>> => {
    return http.post("/role/add", params)
}
// 删除角色接口
export const getroledel = (params: any): Promise<AxiosResponse<any>> => {
    return http.get("/role/del", params)
}
// 修改角色接口
export const getroleedit = (params: any): Promise<AxiosResponse<any>> => {
    return http.post("/role/edit", params)
}
// 查询所有权限 
export const getpermissionlist = (params: any): Promise<AxiosResponse<any>> => {
    return http.get("/permission/list", params)
}
// 角色id找权限
export const getpermissionshow = (params: any): Promise<AxiosResponse<any>> => {
    return http.get("/permission/show", params)
}
// 修改角色权限
export const getpermissionedit = (params: any): Promise<AxiosResponse<any>> => {
    return http.post("/permission/edit", params)
}
export default {
    getrolelist,
    getroledel,
    getpermissionlist,
    getpermissionshow,
    getroleadd, 
    getroleedit,
    getpermissionedit
}